home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / maksiu / lists / amoslist-1295.lzh / AMOSLIST / 000155_Branko.Collin@mpi.nl_Thu Dec 28 10:20:37 1995.msg < prev    next >
Internet Message Format  |  1995-12-31  |  3KB

  1. Received: from tarkan.eds-ms.com (tarkan.eds-ms.com [204.240.136.10]) by mail1.access.digex.net (8.6.12/8.6.12) with SMTP id KAA21130;  for <mcox@access.digex.net> ; Thu, 28 Dec 1995 10:20:36 -0500
  2. Received: from wn1.sci.kun.nl by tarkan.eds-ms.com (5.x/SMI-SVR4)
  3.     id AA15885; Thu, 28 Dec 1995 09:55:43 -0500
  4. Received: from mpih17 by wn1.sci.kun.nl via mpih17.mpi.nl [192.87.79.57] with ESMTP 
  5.     id PAA06388 (8.6.10/2.14); Thu, 28 Dec 1995 15:52:56 +0100
  6. Received: from mpih19.mpi.nl      (mpih19.mpi.nl) by mpih17 (1.37.109.16/2.1) on MPINET
  7.      id AA121842317; Thu, 28 Dec 1995 15:51:57 +0100
  8. From: Branko Collin <Branko.Collin@mpi.nl>
  9. Date: Thu, 28 Dec 1995 15:51:47 +0100 (MET)
  10. X-Sender: bcollin@mpih19
  11. To: Andy Church Andy Church<achurch@dragon.res.cmu.edu>
  12. Cc: amos-list@tarkan.eds-ms.com
  13. Subject: Re: Extensions
  14. In-Reply-To: <199512260335.WAA27865@dragon.res.cmu.edu>
  15. Message-Id: <Pine.HPP.3.91.951228154458.14761H-100000@mpih19>
  16. Mime-Version: 1.0
  17. Content-Type: TEXT/PLAIN; charset=US-ASCII
  18. Status: RO
  19. X-Status: 
  20.  
  21. On Mon, 25 Dec 1995, Andy Church wrote:
  22.  
  23. > >How does one go about making an extension?  I want one to read the CD32 
  24. > >pads.  I already have the C source to do so.  What has to be done to make 
  25. > >it into a couple of commands like Read CD32(1) and Read CD32(2)?
  26. >   Oy.  That is a complicated process.  I'd suggest you start off by looking
  27. > at the source for the Music extension, and go from there.  That's how I
  28. > learned, anyway.
  29.  
  30. How do you know how the Amos tokeniser works? Trial and error? 
  31.  
  32. I have written a tokeniser in LEX for a small subset of Amos (don't ask 
  33. me what for, as it's much to early to tell :-)). Here it is, for those 
  34. interested:
  35.  
  36. NC    [A-Z_]+
  37. LNC    [A-Z][A-Z_]*
  38. CM    "Print Using"|"Print #"|"Print"|"For"|"To"|"Next"|"If"|"Then"|"Else"|"Endif" 
  39. OP    "+"|"-"|"="
  40. %%
  41. _{NC}"$(".*")"        ; { printf("String array: %s\n",yytext); }
  42. _{NC}"$"        ; { printf("String var:   %s\n",yytext); }
  43. _{NC}#\(.*\)        ; { printf("Real array:   %s\n",yytext); }
  44. _{NC}#            ; { printf("Real:         %s\n",yytext); }
  45. _{NC}\[.*\]        ; { printf("Procedure:    %s\n",yytext); }
  46. _{NC}\(.*\)        ; { printf("Int array:    %s\n",yytext); }
  47. _{NC}            ; { printf("Int:          %s\n",yytext); }
  48. {CM}            ; { printf("Command:      %s\n",yytext); }
  49. {LNC}"$(".*")"        ; { printf("String array: %s\n",yytext); }
  50. {LNC}"$"        ; { printf("String var:   %s\n",yytext); }
  51. {LNC}"#(".*")"        ; { printf("Real Array:   %s\n",yytext); }
  52. {LNC}#            ; { printf("Real var:     %s\n",yytext); }
  53. {LNC}"(".*")"        ; { printf("Int Array:    %s\n",yytext); }
  54. {LNC}            ; { printf("Int Var:      %s\n",yytext); }
  55. "\"".+"\""        ; { printf("String const: %s\n",yytext); }
  56. [0-9]+            ; { printf("Int const:    %s\n",yytext); }
  57. {OP}            ; { printf("Operator:     %s\n",yytext); }
  58. [^ \n]            ; { printf("Error:        %s\n",yytext); }
  59. [ \t]+            ;
  60. [\n]            ;
  61. %%
  62.  
  63.  
  64. .......................................................................
  65. .       Branko Collin          .                                      .
  66. .                              .                                      .
  67. .   //  u249026@vm.uci.kun.nl  .                                      .
  68. . \X/   bcollin@mpi.nl         .                                      .
  69. .......................................................................
  70.